<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>demo</title>
  <script type="text/javascript" src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <button @click="count++">增加</button>
    {{count}}
    <input type="text" v-model="first">
    <input type="text" v-model="last">
    <p>{{fullName}}</p>
  </div>
</body>
<script type="text/javascript">
  Vue.config.productionTip = false
  const vm = new Vue({
    el: "#app",
    data() {
      return {
        first: '',
        last: '',
        count: 0
      }
    },
    // 计算属性 这个fullName会作为vm的一个属性来使用 不会重复调用 只有在监听的数组发生改变时才会调用
    computed: {
      fullName() {
        console.log(111);
        return this.first + this.last
      }
    }
  })
</script>

</html>